Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pc/modals: Disable submit buttons on when Formik isSubmitting #2401

Merged

Conversation

ssangervasi
Copy link
Contributor

@ssangervasi ssangervasi commented Jan 27, 2023

Closes #2219

Code Changes

  • Use isSubmitting on all of these forms to prevent repeat clicks
  • Remove the isLoading loading state which is redundant and not implemented correctly.

Steps to Confirm

  • See ticket. Backend has to require identity verification.
  • Check the browser network console to see there is only one /verify call per submit.

Pre-Merge Checklist

Description Of Changes

I couldn't actually reproduce the error banner from the ticket - repeat clicks would send multiple requests but they would respond 200. I tried with and without require_manual_request_approval enabled in fides.test_env.toml.

But either way there's no reason to submit multiple. These modals should all have smart submit buttons.

My screen recorder shows my fast clicks as that animated circle:
https://user-images.githubusercontent.com/2236777/214980028-3bc9b69d-f1ec-403a-8683-de30d783f412.mp4

Also added the loading state:
withloading

@ssangervasi ssangervasi force-pushed the ssangervasi/fides/2219/id-verification-multiple-submit branch from 0130506 to cfa3422 Compare January 27, 2023 00:30
@ssangervasi ssangervasi force-pushed the ssangervasi/fides/2219/id-verification-multiple-submit branch from cfa3422 to 012c371 Compare January 27, 2023 00:38
@ssangervasi ssangervasi force-pushed the ssangervasi/fides/2219/id-verification-multiple-submit branch from 012c371 to 29de6ed Compare January 28, 2023 00:26
@codecov
Copy link

codecov bot commented Jan 28, 2023

Codecov Report

Base: 88.55% // Head: 88.55% // No change to project coverage 👍

Coverage data is based on head (29de6ed) compared to base (6a35107).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2401   +/-   ##
=======================================
  Coverage   88.55%   88.55%           
=======================================
  Files         327      327           
  Lines       15714    15714           
  Branches     4348     4348           
=======================================
  Hits        13915    13915           
  Misses       1644     1644           
  Partials      155      155           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ssangervasi ssangervasi merged commit 9276432 into main Jan 31, 2023
@ssangervasi ssangervasi deleted the ssangervasi/fides/2219/id-verification-multiple-submit branch January 31, 2023 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Identity verification pop-up doesn't close and errors out on multiple submit clicks
2 participants